// 用于构建嵌套评论结构的函数
function buildNestedComments(comments, parentId = null) {
	return comments
		.filter((comment) => comment.parent_id === parentId)
		.map((comment) => ({
			...comment,
			children: buildNestedComments(comments, comment.id)
		}))
}

module.exports = {
	buildNestedComments
}
